package com.ruoyi.common.core.domain.vo;

import java.util.Arrays;
import java.util.List;

/**
 * Description:
 * Author: YangShiWei
 * Email: strongwalter2014@gmail.com
 * Datetime: 2023/4/7 14:18
 */
public interface RiskLevelAware {

    List<String> HIGH_RISK = Arrays.asList("0", "1", "2", "3", "4");
    List<String> MID_RISK = Arrays.asList("5", "6", "7", "8", "9", "10", "11");
    List<String> LOW_RISK = Arrays.asList("12", "13", "14");

    default String getRiskLevel() {
        List<String> fxdjList = getFxdjList();
        if (fxdjList.stream().anyMatch(HIGH_RISK::contains)) {
            return "1";
        }
        if (fxdjList.stream().anyMatch(MID_RISK::contains)) {
            return "2";
        }
        if (fxdjList.stream().anyMatch(LOW_RISK::contains)) {
            return "3";
        }
        return "0";
    }

    List<String> getFxdjList();

}
